package org.hadoop.hive.Utils;

import org.json.JSONObject;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;

/**
 * 作者：Lapper
 * QQ656277239
 * vx:JavaAdmin123
 */
@Component
public class Data {

    public static String[] major = {
            "博士",
            "硕士",
            "本科",
            "专科",
            "高中",
            "高中及以下"
    };
    public static String[] jobPositions = {
            "软件工程师",
            "数据科学家",
            "产品经理",
            "市场营销专员",
            "人力资源经理",
            "销售代表",
            "客户服务代表",
            "财务分析师",
            "运营经理",
            "平面设计师",
            "内容撰写人员",
            "业务拓展经理",
            "质量保证测试员",
            "项目经理",
            "IT支持专员"
    };

    String[] majors = {"计算机科学", "医学", "工程学", "商业管理", "心理学", "艺术设计", "生物学", "物理学", "数学"};
    public String getDateTime() {
        int startYear = 2018;
        int endYear = 2024;

        int year = ThreadLocalRandom.current().nextInt(startYear, endYear + 1);
        int month = ThreadLocalRandom.current().nextInt(1, 13);
        int maxDay = LocalDate.of(year, month, 1).lengthOfMonth();
        int day = ThreadLocalRandom.current().nextInt(1, maxDay + 1);

        LocalDate randomDate = LocalDate.of(year, month, day);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedDate = randomDate.format(formatter);
        return formattedDate;
    }

    public String getEbackground() {
        int index = (int) (Math.random() * major.length);
        return major[index];
    }
 public   String getmajor(){
     int index = (int) (Math.random() * majors.length);
     return majors[index];
 }
    public String getprovinceOrcity() {

                String [] province={
                        "台湾",
                        "东北",
                        "河北",
                        "湖南",
                        "广东",
                        "海南",
                        "福建",
                        "甘肃",
                        "西安"
                };
                int index = (int) (Math.random() * province.length);
                String provinces=province[index];
                return provinces;

}
public  String getJobs(){
    int index = (int) (Math.random() *jobPositions.length);
    return jobPositions[index];
}
public String getAge(){
    Random random = new Random();
    int randomNumber = random.nextInt(58) + 18;
 return String.valueOf(randomNumber);
}
public  String getSalary(){
    Random random = new Random();
    int randomNumber = random.nextInt(22001) + 3000;
    return String.valueOf(randomNumber);
}
}



